package com.tensai.study.features.JDK8.date.localdate;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * 时间解析
 *
 * @author Tensai
 */
@Slf4j
public class ParseTest {

	@Test
	public void test() {
		LocalDate localDate = LocalDate.parse("2021-10-01");
		log.info("date - {}", localDate.toString());
		// 一天的开始
		LocalDateTime startTime = localDate.atStartOfDay();
		log.info("dateTime_start - {}", startTime);
		LocalDateTime maxTime = localDate.atTime(LocalTime.MAX);
		log.info("maxTime_start - {}", maxTime);
		LocalDateTime minTime = localDate.atTime(LocalTime.MIN);
		log.info("minTime_start - {}", minTime);
	}

	@Test
	public void test1() {
		log.info("{}", Integer.parseInt("00"));
	}
}
